package com.bjtu.ptsite.exception;

import com.bjtu.ptsite.model.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 *
 * @author Zehao Wang, Junjie Zhang, Yutao Wei
 *
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(RuntimeException.class)
    public Result handleRuntime(RuntimeException e) {
        return Result.error(e.getMessage());
    }
}
